// 实现批量导入全局公共组件,统一注册
import { App, Component } from "vue";
import Card from "./common/Card.vue";
import Modal from "./common/modal/Modal.vue";

// 定义变量(数组或对象),存放组件对象
const overallCom: Record<string, Component> = { Card, Modal };

export default {
  // 调用vue的install方法
  install(app: App): void {
    Object.keys(overallCom).forEach((key) => {
      app.component(key, overallCom[key]);
    });
  },
};
